package com.sebiotec.ambassador.adapt;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.sebiotec.ambassador.R;
import com.sebiotec.ambassador.model.response.MessageDetailResponse;
import com.sebiotec.basecommon.utils.tools.TimeUtil;


import java.util.List;

public class MsgAdapt extends BaseQuickAdapter< MessageDetailResponse.EventsBean, BaseViewHolder> {

    public MsgAdapt(int layoutResId, @Nullable List<MessageDetailResponse.EventsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageDetailResponse.EventsBean item) {

        switch (item.getBKStatus()) {
            case -1:
                helper.setText(R.id.tv_name, "Booking rejected by");
                break;
            case -2:
                helper.setText(R.id.tv_name, "Booking cancelled by");
                break;
            case 0:
                helper.setText(R.id.tv_name, "Confirmed by");
                break;
            case 1:
                helper.setText(R.id.tv_name, "Confirmed by");
                break;
            case 2:
                helper.setText(R.id.tv_name, "Pickup by ");
                break;
            case 3:
                helper.setText(R.id.tv_name, "Pickup by");
                break;
            case 4:
                helper.setText(R.id.tv_name, "Drop-off by");
                break;
            case 5:
                helper.setText(R.id.tv_name, "Completed  by");
                break;
            case 6:
                helper.setText(R.id.tv_name, "Assigned vehicle by");
                break;
            case 7:
                helper.setText(R.id.tv_name, "Assigned driver by ");
                break;
            case 8:
                helper.setText(R.id.tv_name, "Assigned ambassador by");
                break;


        }
        helper.setText(R.id.tv_green,item.getCreateUser());
        helper.setText(R.id.tv_message_detail_time, TimeUtil.getFormatData_O(item.getCreateDate()));


    }
}